package com.example.demo.controller;

import com.example.demo.entity.User;
import org.springframework.web.bind.annotation.*;

@RestController
public class PostContrlloer {
    @PostMapping("/getPost")
    public String getPost(){
        return "你好";
    }

    @RequestMapping(value = "/getPost1",method = RequestMethod.POST)
    public String getPost1(){
        return "第二中方法";
    }

    @RequestMapping(value = "/getPost2",method = RequestMethod.POST)
    //@RequestBody raw json 形式 没有就是form表单形式
    public String getPost2(@RequestBody User user){
        System.out.print(user);
        return "接受参数";
    }
}
